#!/usr/bin/env python
#-*- coding:utf-8 -*-

import tornado.web
import jinja2
from config.utils import get_settings, _imp_module
from models.users import User, Session

_template_env = jinja2.Environment(
    loader=jinja2.FileSystemLoader(get_settings('template_path')))


class BaseRequestHandler(tornado.web.RequestHandler):
    template_env = _template_env

    def get_current_user(self):
        sessionid = self.get_secure_cookie("sessionid")
        if not sessionid:
            return None
